﻿@model IEnumerable<TalentDesk.Contracts.Ef.Project>



@(Html.Kendo().Grid<TalentDesk.Contracts.Ef.Project>()
.Name("Denem")
.Columns(column =>
    {
        column.Bound(p => p.ProjectName);
        column.Command(command =>
        {
            command.Custom("Edit").DataRouteValues(route => route.Add(o => o.ProjectId).RouteKey("projectId")).Click("showEdit");
        }
            );
    })
    .Selectable(selectable => selectable
            .Enabled(true)
            .Mode(GridSelectionMode.Single)
            )
     .Groupable()
    .Pageable()
    .Sortable()
    .Scrollable()
    .Filterable()
    .DataSource(dataSource => dataSource
        .Ajax()
        .Read(read => read.Action("_GetProject", "Project"))
    )
)




<script type="text/javascript">

    function ShowNewAboneBilgilendirmeWindow() {
        $.post('@Url.Action("AboneBilgilendirmeYeniKayit", "AboneBilgilendirme")',
             function (data) {
                 var thkWindowElement = $('#windowProjectEdit');
                 thkWindowElement.data('tWindow').content(data);
                 thkWindowElement.data('tWindow').title("Yeni Abone Bilgilendirme kayıt");
                 thkWindowElement.data('tWindow').center().open();
             }
            , 'html');
    };
    function showEdit(e) {
        e.preventDefault();

        var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
     
        $.post(
            '@Url.Action("_EditProject", "Project")',
            
             { "projectId": dataItem.ProjectId }, 
             function (result) {
                 $('#divProjectDetail').html(result);

                 //var thkWindowElement = $('#windowProjectEdit');
                 //thkWindowElement.data('kendoWindow').content(result);
                 //thkWindowElement.data('kendoWindow').title("Yeni Abone Bilgilendirme kayıt");
                 //thkWindowElement.data('kendoWindow').center().open();
             }
        , 'html');
       
    }
</script>


    <div id="divProjectDetail">asdasdas</div>

 @(Html.Kendo().Window()
    .Name("windowProjectEdit")
   
  
        .Width(500)
        
        .Draggable()
        .Resizable()
        .Title("Rams's Ten Principles of Good Design")
        .Actions(actions => actions.Refresh().Close())
        .Visible(false)



)



